<div class="widgets">

  <div class="row">
  <div class="row">
    <div class="col-xs-12">
      <ba-card baCardClass="with-scroll">
        <div class="section">
          <form (ngSubmit)="search()" class="form-horizontal">
            <div class="form-group row">

              <div class="col-sm-5">
                <label for="idcard" class="col-sm-5 control-label">身&nbsp;&nbsp;份&nbsp;&nbsp;证</label>
                <div class="col-sm-7">
                  <input [(ngModel)]="searchForm.idcard" name="idcard" type="text" class="form-control">
                </div>
              </div>

              <div class="col-sm-5">
                <label for="name" class="col-sm-5 control-label">姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名</label>
                <div class="col-sm-7">
                  <input [(ngModel)]="searchForm.name" name="name" type="text" class="form-control">
                </div>
              </div>

            </div>

            <div class="form-group row">

              <div class="col-sm-5">
                <label for="sex" class="col-sm-5 control-label">性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别</label>
                <div class="col-sm-7">
                  <select [(ngModel)]="searchForm.sex" name="sex" type="text" class="form-control">
                    <option value="">全部</option>
                    <option value="男">男</option>
                    <option value="女">女</option>
                  </select>
                </div>
              </div>

              <div class="col-sm-5">
                <label for="verified" class="col-sm-5 control-label">申请状态</label>
                <div class="col-sm-7">
                  <select [(ngModel)]="searchForm.verified" name="verified" type="text" class="form-control">
                    <option value="待审核">待审核</option>
                    <option value="通过">通过</option>
                    <option value="未通过">未通过</option>
                    <option value="">全部</option>
                  </select>
                </div>
              </div>
            </div>

            <div class="form-group row">
              <div class="col-sm-5">
                <label id="publishTimeLabel" class="col-sm-5 control-label" for="startdate">时&nbsp;&nbsp;间&nbsp;&nbsp;段</label>

                <div class="col-sm-7" id="publishTimeCol">
                  <date-range-picker (onSelected)="updateDateRange($event)"></date-range-picker>
                </div>
              </div>

              <div class="col-sm-5"></div>

              <div class="col-sm-2">
                <button type="submit" class="btn btn-primary pull-left"><i class="fa fa-search" aria-hidden="true"></i>
                  查询
                </button>
              </div>
            </div>
          </form>
        </div>
        <div class="section btn-section btn-toolbar">
          <a role="button" class="btn btn-primary btn-review" [ngClass]="{'disabled': disableReviewBtn}"
          (click)="review()">查看</a>
          <a role="button" class="btn btn-success btn-review" [ngClass]="{'disabled': disablePassBtn}"
             (click)="showPassModal()">通过</a>
          <a role="button" class="btn btn-danger btn-reject" [ngClass]="{'disabled': disableRejectBtn}"
             (click)="showRejectModal()">驳回</a>
          <a role="button" class="btn btn-danger btn-reject" [ngClass]="{'disabled': disableDeleteBtn}"
             (click)="showDeleteModal()">删除</a>
         <!-- <a role="button" class="btn btn-info btn-download" [ngClass]="{'disabled': disableDownloadBtn}"
             href="{{downloadUrlByPoint}}" download target="_blank">下载信息(点选)</a>
          <a role="button" class="btn btn-info btn-download" [ngClass]="{'disabled': disableDownloadTimeBtn}"
             (click)="showTimeModal()">下载信息(时间)</a>-->
          <span *ngIf="errorShow">请重新登录</span>
          <!--<a role="button" class="btn btn-info btn-download" [ngClass]="{'disabled': disableDownloadBtn}"-->
             <!--href="{{downloadUrl}}" download target="_blank">下载申请</a>-->
        </div>
        <div class="section">
          <data-tables [searchParams]="searchForm" [config]="dataTablesConfig"
                       (onSelect)="tableRowSelect($event)"  (onError)="handleError($event)" (onError)="handleError($event)"></data-tables>
        </div>
      </ba-card>
    </div>
  </div>
</div>

<div bsModal #apprPassModal="bs-modal" class="modal fade" tabindex="-1" role="dialog"
     aria-labelledby="entRegApprModalLabel"
     aria-hidden="true" (onHide)="onHideModal()">
  <div class="modal-dialog modal-lg">
    <div class="modal-content" style="color: #000;">
      <div class="modal-header">
        <button class="close" (click)="apprPassClose()" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
        <h4 class="modal-title">审核通过</h4>
      </div>

      <div class="modal-body">
        <div class="auth-block">
          <div class="form-group">
            <label for="textarea01">审核意见</label>
            <textarea class="form-control" #passComment></textarea>
            <span *ngIf="_errorMsg">{{_errorMsg}}</span>
          </div>
        </div>
      </div>

      <div class="modal-footer">
        <button class="btn btn-primary confirm-btn" (click)="pass(passComment.value)">提交</button>
        <button class="btn btn-default" (click)="apprPassClose()">取消</button>
      </div>
    </div>
  </div>
</div>

<div bsModal #apprRejectModal="bs-modal" class="modal fade" tabindex="-1" role="dialog"
     aria-labelledby="entRegApprModalLabel"
     aria-hidden="true" (onHide)="onHideModal()">
  <div class="modal-dialog modal-lg">
    <div class="modal-content" style="color: #000;">
      <div class="modal-header">
        <button class="close" (click)="apprRejectClose()" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
        <h4 class="modal-title">审核驳回</h4>
      </div>

      <div class="modal-body">
        <div class="auth-block">
          <div class="form-group">
            <label for="textarea01">审核意见</label>
            <textarea class="form-control" #rejcetComment></textarea>
            <span *ngIf="_errorMsg">{{_errorMsg}}</span>
          </div>
        </div>
      </div>

      <div class="modal-footer">
        <button class="btn btn-primary confirm-btn" (click)="reject(rejcetComment.value)">提交</button>
        <button class="btn btn-default" (click)="apprRejectClose()">取消</button>
      </div>
    </div>
  </div>
</div>

<div bsModal #apprReviewModal="bs-modal" class="modal fade" tabindex="-1" role="dialog"
     aria-labelledby="entRegApprModalLabel"
     aria-hidden="true" (onHide)="onHideModal()">
  <div class="modal-dialog modal-lg">
    <div class="modal-content" style="color: #000;">
      <div class="modal-header">
        <button class="close" (click)="apprReviewModal.hide()" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
        <h4 class="modal-title">详情</h4>
      </div>

      <div class="modal-body">
        <div class="auth-block">
          <div class="row">
            <div class="col-xs-6">
              <h2>原信息</h2>
              <form class="form-horizontal" *ngIf="originDetailData">
                <div class="form-group row"><label class="col-sm-5 form-control-label">姓名</label>
                  <div class="col-sm-7"><input type="text" class="form-control"
                                               value="{{originDetailData.name}}" readonly>
                  </div>
                </div>
                <div class="form-group row"><label class="col-sm-5 form-control-label">性别</label>
                  <div class="col-sm-7"><input type="text" class="form-control" value="{{originDetailData.sex}}"
                                               readonly>
                  </div>
                </div>
                <div class="form-group row"><label class="col-sm-5 form-control-label">身份证</label>
                  <div class="col-sm-7"><input type="text" class="form-control"
                                               [value]="originDetailData.idcard" readonly>
                  </div>
                </div>
                <div class="form-group row"><label class="col-sm-5 form-control-label">出生日期</label>
                  <div class="col-sm-7"><input type="text" class="form-control"
                                               [value]="originDetailData.birthday" readonly>
                  </div>
                </div>
                <div class="form-group row"><label class="col-sm-5 form-control-label">政治面貌</label>
                  <div class="col-sm-7"><input type="text" class="form-control"
                                               [value]="originDetailData.government" readonly>
                  </div>
                </div>
                <div class="form-group row"><label class="col-sm-5 form-control-label">地址</label>
                  <div class="col-sm-7"><input type="text" class="form-control"
                                               [value]="originDetailData.address" readonly>
                  </div>
                </div>
                <div class="form-group row"><label class="col-sm-5 form-control-label">联系方式</label>
                  <div class="col-sm-7"><input type="text" class="form-control"
                                               [value]="originDetailData.telephone" readonly>
                  </div>
                </div>
                <div class="form-group row"><label class="col-sm-5 form-control-label">民族</label>
                  <div class="col-sm-7"><input type="text" class="form-control"
                                               [value]="originDetailData.folk" readonly>
                  </div>
                </div>
                <div class="form-group row"><label class="col-sm-5 form-control-label">省份</label>
                  <div class="col-sm-7"><input type="text" class="form-control"
                                               [value]="originDetailData.province" readonly>
                  </div>
                </div>
                <div class="form-group row"><label class="col-sm-5 form-control-label">毕业院校</label>
                  <div class="col-sm-7"><input type="text" class="form-control"
                                               [value]="originDetailData.schoolname" readonly>
                  </div>
                </div>
                <div class="form-group row"><label class="col-sm-5 form-control-label">专业</label>
                  <div class="col-sm-7"><input type="text" class="form-control"
                                               [value]="originDetailData.speciality" readonly>
                  </div>
                </div>
                <div class="form-group row"><label class="col-sm-5 form-control-label">毕业时间</label>
                  <div class="col-sm-7"><input type="text" class="form-control"
                                               [value]="originDetailData.finishschooldate" readonly>
                  </div>
                </div>
                <div class="form-group row"><label class="col-sm-5 form-control-label">公司名称</label>
                  <div class="col-sm-7"><input type="text" class="form-control"
                                               [value]="originDetailData.companyname" readonly>
                  </div>
                </div>
                <!--<div class="form-group row" *ngIf="originDetailData.verified != '待审核'"><label class="col-sm-5 form-control-label">审核意见</label>-->
                  <!--<div class="col-sm-7"><input type="text" class="form-control"-->
                                               <!--[value]="originDetailData.reason" readonly>-->
                  <!--</div>-->
                <!--</div>-->
              </form>

            </div>
            <div class="col-xs-6">
              <h2 style="color: #93D4E7;">新信息</h2>
              <form class="form-horizontal" *ngIf="_selectdAppr">
                <div *ngIf="_selectdAppr.verified == '待审核'">
                  <div class="form-group row"><label class="col-sm-5 form-control-label">姓名</label>
                    <div class="col-sm-7" *ngIf="_selectdAppr.name == originDetailData.name">
                      <input type="text" class="form-control" value="{{_selectdAppr.name}}" style="color:#000000" readonly>
                    </div>
                    <div class="col-sm-7" *ngIf="_selectdAppr.name != originDetailData.name">
                      <input type="text"  class="form-control" value="{{_selectdAppr.name}}" style="color:#93D4E7" readonly>
                    </div>
                  </div>
                  <div class="form-group row"><label class="col-sm-5 form-control-label">性别</label>
                    <div class="col-sm-7" *ngIf="_selectdAppr.sex == originDetailData.sex">
                      <input type="text" class="form-control" value="{{_selectdAppr.sex}}" style="color:#000000" readonly>
                    </div>
                    <div class="col-sm-7" *ngIf="_selectdAppr.sex != originDetailData.sex">
                      <input type="text"  class="form-control" value="{{_selectdAppr.sex}}" style="color:#93D4E7" readonly>
                    </div>
                  </div>
                  <div class="form-group row"><label class="col-sm-5 form-control-label">身份证</label>
                    <div class="col-sm-7" *ngIf="_selectdAppr.idcard == originDetailData.idcard">
                      <input type="text" class="form-control" style="color:#000000"[value]="_selectdAppr.idcard" readonly>
                    </div>
                    <div class="col-sm-7" *ngIf="_selectdAppr.idcard != originDetailData.idcard">
                      <input type="text"  class="form-control" value="{{_selectdAppr.idcard}}" style="color:#93D4E7" readonly>
                    </div>
                  </div>
                  <div class="form-group row"><label class="col-sm-5 form-control-label">出生日期</label>
                    <div class="col-sm-7" *ngIf="_selectdAppr.birthday == originDetailData.birthday">
                      <input type="text" class="form-control" style="color:#000000"
                                                 [value]="_selectdAppr.birthday" readonly>
                    </div>
                    <div class="col-sm-7" *ngIf="_selectdAppr.birthday != originDetailData.birthday">
                      <input type="text"  class="form-control" value="{{_selectdAppr.birthday}}" style="color:#93D4E7" readonly>
                    </div>
                  </div>
                  <div class="form-group row"><label class="col-sm-5 form-control-label">政治面貌</label>
                    <div class="col-sm-7" *ngIf="_selectdAppr.government == originDetailData.government">
                      <input type="text" style="color:#000000" class="form-control"
                                                 [value]="_selectdAppr.government" readonly>
                    </div>
                    <div class="col-sm-7" *ngIf="_selectdAppr.government != originDetailData.government">
                      <input type="text"  class="form-control" value="{{_selectdAppr.government}}" style="color:#93D4E7" readonly>
                    </div>
                  </div>
                  <div class="form-group row"><label class="col-sm-5 form-control-label">地址</label>
                    <div class="col-sm-7" *ngIf="_selectdAppr.address == originDetailData.address"><input type="text" style="color:#000000" class="form-control"
                                                 [value]="_selectdAppr.address" readonly>
                    </div>
                    <div class="col-sm-7" *ngIf="_selectdAppr.address != originDetailData.address">
                      <input type="text"  class="form-control" value="{{_selectdAppr.address}}" style="color:#93D4E7" readonly>
                    </div>
                  </div>

                  <div class="form-group row"><label class="col-sm-5 form-control-label">联系方式</label>
                    <div class="col-sm-7" *ngIf="_selectdAppr.telephone == originDetailData.telephone"><input type="text" style="color:#000000" class="form-control"
                                                 [value]="_selectdAppr.telephone" readonly>
                    </div>
                    <div class="col-sm-7" *ngIf="_selectdAppr.telephone != originDetailData.telephone">
                      <input type="text"  class="form-control" value="{{_selectdAppr.telephone}}" style="color:#93D4E7" readonly>
                    </div>
                  </div>
                </div>
                <div *ngIf="_selectdAppr.verified != '待审核'">
                  <div class="form-group row"><label class="col-sm-5 form-control-label">姓名</label>
                    <div class="col-sm-7">
                      <input type="text" id="newName" class="form-control" value="{{_selectdAppr.name}}" readonly>
                    </div>
                  </div>
                  <div class="form-group row"><label class="col-sm-5 form-control-label">性别</label>
                    <div class="col-sm-7"><input type="text" id="newsex" class="form-control" value="{{_selectdAppr.sex}}"
                                                 readonly>
                    </div>
                  </div>
                  <div class="form-group row"><label class="col-sm-5 form-control-label">身份证</label>
                    <div class="col-sm-7"><input type="text" id="newIdCard" class="form-control"
                                                 [value]="_selectdAppr.idcard" readonly>
                    </div>
                  </div>
                  <div class="form-group row"><label class="col-sm-5 form-control-label">出生日期</label>
                    <div class="col-sm-7"><input type="text" class="form-control" id="newBirthday"
                                                 [value]="_selectdAppr.birthday" readonly>
                    </div>
                  </div>
                  <div class="form-group row"><label class="col-sm-5 form-control-label">政治面貌</label>
                    <div class="col-sm-7"><input type="text" id="newGovernment" class="form-control"
                                                 [value]="_selectdAppr.government" readonly>
                    </div>
                  </div>
                  <div class="form-group row"><label class="col-sm-5 form-control-label">地址</label>
                    <div class="col-sm-7"><input type="text" id="newAddress" class="form-control"
                                                 [value]="_selectdAppr.address" readonly>
                    </div>
                  </div>

                  <div class="form-group row"><label class="col-sm-5 form-control-label">联系方式</label>
                    <div class="col-sm-7"><input type="text" id="newTelephone" class="form-control"
                                                 [value]="_selectdAppr.telephone" readonly>
                    </div>
                  </div>
                </div>
                <div class="form-group row"><label class="col-sm-5 form-control-label">民族</label>
                  <div class="col-sm-7"><input type="text" class="form-control"
                                               [value]="_selectdAppr.folk" readonly>
                  </div>
                </div>
                <div class="form-group row"><label class="col-sm-5 form-control-label">省份</label>
                  <div class="col-sm-7"><input type="text" class="form-control"
                                               [value]="_selectdAppr.province" readonly>
                  </div>
                </div>
                <div class="form-group row"><label class="col-sm-5 form-control-label">毕业院校</label>
                  <div class="col-sm-7"><input type="text" class="form-control"
                                               [value]="_selectdAppr.schoolname" readonly>
                  </div>
                </div>
                <div class="form-group row"><label class="col-sm-5 form-control-label">专业</label>
                  <div class="col-sm-7"><input type="text" class="form-control"
                                               [value]="_selectdAppr.speciality" readonly>
                  </div>
                </div>
                <div class="form-group row"><label class="col-sm-5 form-control-label">毕业时间</label>
                  <div class="col-sm-7"><input type="text" class="form-control"
                                               [value]="_selectdAppr.finishschooldate" readonly>
                  </div>
                </div>
                <div class="form-group row"><label class="col-sm-5 form-control-label">公司名称</label>
                  <div class="col-sm-7"><input type="text" class="form-control"
                                               [value]="_selectdAppr.companyname" readonly>
                  </div>
                </div>
                <div class="form-group row" *ngIf="_selectdAppr.verified != '待审核'"><label class="col-sm-5 form-control-label">审核意见</label>
                  <div class="col-sm-7"><input type="text" class="form-control"
                                                [value]="_selectdAppr.verifydescription" readonly>
                  </div>
                </div>
                <div class="form-group row" *ngIf="_selectdAppr.verified != '待审核'"><label class="col-sm-5 form-control-label">审核时间</label>
                  <div class="col-sm-7"><input type="text" class="form-control"
                                               [value]="_selectdAppr.verifytime" readonly>
                  </div>
                </div>
                <div class="form-group row" *ngIf="_selectdAppr.verified === '待审核'">
                  <label for="textarea01" class="col-sm-5 form-control-label">审核意见</label>
                  <div class="col-sm-7">
                    <textarea class="form-control" #CheckComment></textarea>
                    <a role="button" class="btn btn-success btn-pass check"(click)="pass(CheckComment.value)">通过</a>
                    <a role="button" class="btn btn-danger btn-reject check"(click)="reject(CheckComment.value)">驳回</a>
                  </div>
                </div>
              </form>
            </div>

          </div>
        </div>
      </div>

      <div class="modal-footer">
        <button class="btn btn-default" (click)="apprReviewModal.hide()">关闭</button>
      </div>
    </div>
  </div>
</div>

<div bsModal #apprDeleteModal="bs-modal" class="modal fade" tabindex="-1" role="dialog"
     aria-labelledby="entRegApprModalLabel"
     aria-hidden="true" (onHide)="onHideModal()">
  <div class="modal-dialog modal-lg">
    <div class="modal-content" style="color: #000;">
      <div class="modal-header">
        <button class="close" (click)="apprDeleteClose()" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
        <h4 class="modal-title">删除</h4>
      </div>

      <div class="modal-body">
        确定要删除吗
      </div>

      <div class="modal-footer">
        <button class="btn btn-primary confirm-btn" (click)="delete()">删除</button>
        <button class="btn btn-default" (click)="apprDeleteClose()">取消</button>
      </div>
    </div>
  </div>
</div>

<div bsModal #apprTimeModal="bs-modal" class="modal fade" tabindex="-1" role="dialog"
     aria-labelledby="entRegApprModalLabel"
     aria-hidden="true" (onHide)="onHideModal()">
  <div class="modal-dialog modal-lg">
    <div class="modal-content" style="color: #000;">
      <div class="modal-header">
        <button class="close" (click)="apprTimeClose()" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
        <h4 class="modal-title">按时间段下载</h4>
      </div>

      <div class="modal-body">
        <div class="auth-block">
          <div class="form-group">
            <label class="control-label" for="startdate">时间段</label>

            <div >
              <date-range-picker (onSelected)="getStage($event)"></date-range-picker>
            </div>
          </div>
        </div>
      </div>

      <div class="modal-footer">
        <a class="btn btn-primary confirm-btn" href="{{downloadUrlByStage}}" download target="_blank" (click)="apprTimeClose()">提交</a>
        <button class="btn btn-default" (click)="apprTimeClose()">取消</button>
      </div>
    </div>
  </div>
</div>
